/**
 * Created with JetBrains WebStorm.
 * User: Abdelkrim
 * Date: 2013/08/21
 * Time: 00:00
 * Copyright (c) 2013 ALT-F1, We believe in the projects we work on™
 */
/*
 * GET home page.
 */
//Navegacion
'use strict';
module.exports = function (app) {
    //Buscar una mejor manera de pasar los argumentos ... que flojera!
    app.get('/', function (req, res) {
        res.locals.path = req.path;
        res.render('bootstrap3-templates/' + 'home', {
            'pathToAssets': '/bootstrap-3.0.0',
            'pathToSelectedTemplateWithinBootstrap' : '/bootstrap-3.0.0/examples/' + 'offcanvas',
            'link': 'home',
            'logged': false
        });
    });
    app.get('/login', function (req, res) {
        res.render('bootstrap3-templates/' + 'login', {
            'pathToAssets': '/bootstrap-3.0.0',
            'pathToSelectedTemplateWithinBootstrap' : '/bootstrap-3.0.0/examples/' + 'offcanvas',
            'link': 'login',
            'logged': false
        });
    });
    app.get('/logged', function (req, res) {
        res.render('bootstrap3-templates/' + 'logged', {
            'pathToAssets': '/bootstrap-3.0.0',
            'pathToSelectedTemplateWithinBootstrap' : '/bootstrap-3.0.0/examples/' + 'offcanvas',
            'link': 'logged',
            'logged': true
        });
    });
    app.get('/gastos', function (req, res) {
        res.render('bootstrap3-templates/' + 'gastos', {
            'pathToAssets': '/bootstrap-3.0.0',
            'pathToSelectedTemplateWithinBootstrap' : '/bootstrap-3.0.0/examples/' + 'offcanvas',
            'link': 'gastos',
            'logged': true
        });
    });
    app.get('/gastos/agregar', function (req, res) {
        res.render('bootstrap3-templates/' + 'pago-agregar', {
            'pathToAssets': '/bootstrap-3.0.0',
            'pathToSelectedTemplateWithinBootstrap' : '/bootstrap-3.0.0/examples/' + 'offcanvas',
            'link': 'gastos',
            'logged': true
        });
    });
    /*app.get('/logged', function (req, res) {
        res.render('bootstrap3-templates/' + 'home', {
            'pathToAssets': '/bootstrap-3.0.0',
            'pathToSelectedTemplateWithinBootstrap' : '/bootstrap-3.0.0/examples/' + 'offcanvas',
            'link':"logged"
        });
    });*/
    app.get('/about', function (req, res) {
        res.redirect('http://www.alt-f1.be');
    });
    app.get('/contact', function (req, res) {
        res.redirect('http://www.alt-f1.be/contact-us.html');
    });
    app.get('/template/:selectedTemplate', function (req, res) {
        res.render('bootstrap3-templates/' + req.params.selectedTemplate, {
            'pathToAssets': '/bootstrap-3.0.0',
            'pathToSelectedTemplateWithinBootstrap' : '/bootstrap-3.0.0/examples/' + req.params.selectedTemplate
        });
    });
};